package com.woniuxy.controller;


import com.woniuxy.controller.form.AccountForm;
import com.woniuxy.controller.form.RuleIdForm;
import com.woniuxy.controller.info.Result;
import com.woniuxy.model.Account;
import com.woniuxy.service.MenusService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.xml.transform.Source;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Kevin Martin
 * @since 2022-03-15
 */
@RestController
@RequestMapping("/menus")
public class MenusController {
    @Resource
    private MenusService menusService;
    @PostMapping("getmenus")
    public Result getMenus(@RequestBody AccountForm accountForm){
        return menusService.getMenusbyId(accountForm.getAccountId());
    }
    @PostMapping("getAllMenusWithIndentify")
    public Result getAllMenusWithIndentify(){
        return menusService.getAllMenusWithIndentify();
    }

    @PostMapping("getDefaultKey")
    public Result getDefaultKey(@RequestBody RuleIdForm ruleIdForm){
        return menusService.getDefaultKey(ruleIdForm.getRuleId());
    }
}

